# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=fs-nyarl
pkgver=1.0
pkgrel=7
groups=('blackarch' 'blackarch-scanner' 'blackarch-networking'
        'blackarch-forensic' 'blackarch-spoof' 'blackarch-exploitation'
        'blackarch-sniffer')
pkgdesc='A network takeover & forensic analysis tool - useful to advanced PenTest tasks & for fun and profit.'
arch=('x86_64')
url='http://www.fulgursecurity.com/en/content/fs-nyarl'
license=('custom:unknown')
depends=('chaosreader' 'ettercap' 'dsniff' 'arp-scan'  'beef' 'p0f' 'mitmproxy'
        'tcpdump' 'metasploit' 'macchanger' 'hamster' 'foremost' 'sslstrip'
        'sslsplit')
source=("http://download1582.mediafire.com/ffgf5ezka12g/qdrux66d8kg1sy6/FS-NyarL_v$pkgver-kali.tar.gz")
#source=("http://www.fulgursecurity.com/tools/fs-nyarl/FS-NyarL_v$pkgver-kali.tar.gz")
sha512sums=('bdf8adb6c3e7ff81a77e54f4440b3fb2bf585e27df31e5e0f2d711190b8b89fb7c1152a63b0931a4add9a2ee1d74518bef73ab2a92fbb06de95e281878b3db2b')

package() {
  cd "FS-NyarL_v$pkgver-kali"

  install -dm 755 "$pkgdir/usr/bin"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/doc/$pkgname"

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname" README CHANGELOG TODO \
    docs/FS-NyarL.jpg docs/FS-NyarL_Manual_v1.0.pdf

  rm -rf README CHANGELOG TODO docs

  cp -a * "$pkgdir/usr/share/$pkgname/"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
cd /usr/share/$pkgname
exec ./FS-NyarL "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

